<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
<meta charset="UTF-8">
<title>我的股票</title>
    <link href="../css/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" id="mylink"/>
    <script src="../js/lib/jquery-3.1.1.js" type="text/javascript"></script>
    <script src="../js/lib/ligerui.all.js" type="text/javascript"></script>
    <script src="../js/lib/plugins/ligerTab.js" type="text/javascript"></script>
    <script src="../js/lib/jquery.cookie.js" type="text/javascript"></script>
    <script src="../js/lib/json2.js" type="text/javascript"></script>
    <script src="../js/lib/plugins/ligerDialog.js" type="text/javascript"></script>
    <script src="../js/lib/plugins/ligerTextBox.js" type="text/javascript"></script>
    <script src="../js/lib/plugins/ligerCheckBox.js" type="text/javascript"></script>
    <script src="../js/lib/plugins/ligerComboBox.js" type="text/javascript"></script>
    <script src="../js/lib/plugins/ligerGrid.js" type="text/javascript"></script>
    <script src="../js/lib/plugins/ligerDateEditor.js" type="text/javascript"></script>
    <script src="../js/lib/plugins/ligerSpinner.js" type="text/javascript"></script>
    <script src="../js/lib/plugins/ligerToolBar.js" type="text/javascript"></script>
    <script src="../js/lib/plugins/ligerPopupEdit.js" type="text/javascript"></script>
    <script src="../js/lib/plugins/ligerResizable.js" type="text/javascript"></script>
    <script src="../js/lib/indexdata.js" type="text/javascript"></script>
    <script src="../js/showLhb.js" type="text/javascript"></script>
    <script src="../js/showZtsj.js" type="text/javascript"></script>
    <script src="../js/spmm.js" type="text/javascript"></script>
    <script src="../js/showCcgp.js" type="text/javascript"></script>
    <script src="../js/gfls.js" type="text/javascript"></script>
    <script src="../js/gflsfx.js" type="text/javascript"></script>
    <script src="../js/spfx.js" type="text/javascript"></script>
    <script src="../js/ztsjfx.js" type="text/javascript"></script>
    <script src="../js/stock.js" type="text/javascript"></script>
    <script src="../js/getDxjl.js" type="text/javascript"></script>
    <script src="../js/getZdb.js" type="text/javascript"></script>
</head>
<script th:inline="javascript">
    var who = [[${who}]];
    console.log("who",who);
</script>
<script type="text/javascript">
    /*<![CDATA[*/
    var tab = null;
    var accordion = null;
    var tree = null;
    var tabItems = [];


    $(function ()
    {

        //布局
        $("#layout1").ligerLayout({ leftWidth: 190, height: '100%',heightDiff:-34,space:4, onHeightChanged: f_heightChanged });

        var height = $(".l-layout-center").height();



        //Tab
        $("#framecenter").ligerTab({
            height: height,
            showSwitchInTab : true,
            showSwitch: true,
            onAfterAddTabItem: function (tabdata)
            {
                console.log("onAfterAddTabItem:",tabdata)
                tabItems.push(tabdata);
                saveTabStatus();
                // console.log(tabdata.url);
                var tabid = tabdata.tabid;
                eval(tabdata.url);
            },
            onAfterRemoveTabItem: function (tabid)
            {
                for (var i = 0; i < tabItems.length; i++)
                {
                    var o = tabItems[i];
                    if (o.tabid == tabid)
                    {
                        tabItems.splice(i, 1);
                        saveTabStatus();
                        break;
                    }
                }
            },
            onReload: function (tabdata)
            {
                console.log("onReload:",tabdata)
                var tabid = tabdata.tabid;
                addFrameSkinLink(tabid);
            }
        });

        //面板
        $("#accordion1").ligerAccordion({
            height: height - 24, speed: null
        });

        $(".l-link").hover(function ()
        {
            $(this).addClass("l-link-over");
        }, function ()
        {
            $(this).removeClass("l-link-over");
        });
        //树
        /*
        $("#tree1").ligerTree({
            data : indexdata,
            checkbox: false,
            slide: false,
            nodeWidth: 120,
            attribute: ['nodename', 'url'],
            render : function(a){
                if (!a.isnew) return a.text;
                return '<a href="' + a.url + '" target="_blank">' + a.text + '</a>';
            },
            onSelect: function (node)
            {
                if (!node.data.url) return;
                if (node.data.isnew)
                {
                    return;
                }
                var tabid = $(node.target).attr("tabid");
                if (!tabid)
                {
                    tabid = new Date().getTime();
                    $(node.target).attr("tabid", tabid)
                }
                f_addTab(tabid, node.data.text, node.data.url);
            }
        });
*/
        indexdata();
        function openNew(url)
        {
            var jform = $('#opennew_form');
            if (jform.length == 0)
            {
                jform = $('<form method="post" />').attr('id', 'opennew_form').hide().appendTo('body');
            } else
            {
                jform.empty();
            }
            jform.attr('action', url);
            jform.attr('target', '_blank');
            jform.trigger('submit');
        };


        tab = liger.get("framecenter");
        accordion = liger.get("accordion1");
        // tree = liger.get("tree1");
        $("#pageloading").hide();

        pages_init();
    });
    function f_heightChanged(options)
    {
        if (tab)
            tab.addHeight(options.diff);
        if (accordion && options.middleHeight - 24 > 0)
            accordion.setHeight(options.middleHeight - 24);
    }
    function f_addTab(tabid, text, url)
    {
        tab.addTabItem({
            tabid: tabid,
            text: text,
             url: url,
            callback: function ()
            {

                // addShowCodeBtn(tabid);
                addFrameSkinLink(tabid);
            }
        });
    }
    function f_addTab2(tabid, text, callback)
    {
        tab.addTabItem({
            tabid: tabid,
            text: text,
            callback: eval(callback)
        });
    }
    function addShowCodeBtn(tabid)
    {

        var viewSourceBtn = $('<a class="viewsourcelink" href="javascript:void(0)">查看源码</a>');
        var jiframe = $("#" + tabid);
        viewSourceBtn.insertBefore(jiframe);
        viewSourceBtn.click(function ()
        {
            showCodeView(jiframe.attr("src"));
        }).hover(function ()
        {
            viewSourceBtn.addClass("viewsourcelink-over");
        }, function ()
        {
            viewSourceBtn.removeClass("viewsourcelink-over");
        });
    }
    function addFrameSkinLink(tabid)
    {
        // var prevHref = getLinkPrevHref(tabid) || "";
        var skin = getQueryString("skin");
        if (!skin) return;
        skin = skin.toLowerCase();
        // attachLinkToFrame(tabid, prevHref );
    }
    function pages_init()
    {

        var tabJson = $.cookie('liger-home-tab');
        // console.log("tabJson:",tabJson);
        if (tabJson)
        {
            var tabitems = JSON2.parse(tabJson);
            for (var i = 0; tabitems && tabitems[i];i++)
            {
                f_addTab(tabitems[i].tabid, tabitems[i].text, tabitems[i].url);
            }
        }
        getDxjl("home");
        // console.log("home");
        // tab.selectTabItem("home");
    }
    function saveTabStatus()
    {
        // console.log(tabItems);
        $.cookie('liger-home-tab', JSON2.stringify(tabItems));
    }
    function getQueryString(name)
    {
        var now_url = document.location.search.slice(1), q_array = now_url.split('&');
        for (var i = 0; i < q_array.length; i++)
        {
            var v_array = q_array[i].split('=');
            if (v_array[0] == name)
            {
                return v_array[1];
            }
        }
        return false;
    }
    function attachLinkToFrame(iframeId, filename)
    {
        if(!window.frames[iframeId]) return;
        var head = window.frames[iframeId].document.getElementsByTagName('head').item(0);
        var fileref = window.frames[iframeId].document.createElement("link");
        if (!fileref) return;
        fileref.setAttribute("rel", "stylesheet");
        fileref.setAttribute("type", "text/css");
        fileref.setAttribute("href", filename);
        head.appendChild(fileref);
    }
    function getLinkPrevHref(iframeId)
    {
        if (!window.frames[iframeId]) return;
        var head = window.frames[iframeId].document.getElementsByTagName('head').item(0);
        var links = $("link:first", head);
        for (var i = 0; links[i]; i++)
        {
            var href = $(links[i]).attr("href");
            if (href && href.toLowerCase().indexOf("ligerui") > 0)
            {
                return href.substring(0, href.toLowerCase().indexOf("lib") );
            }
        }
    }
    /*]]>*/
</script>
<style type="text/css">
    /*<![CDATA[*/
    body,html{height:100%;}
    body{ padding:0px; margin:0;   overflow:hidden;}
    .l-link{ display:block; height:26px; line-height:26px; padding-left:10px; text-decoration:underline; color:#333;}
    .l-link2{text-decoration:underline; color:white; margin-left:2px;margin-right:2px;}
    .l-layout-top{background:#102A49; color:White;}
    .l-layout-bottom{ background:#E5EDEF; text-align:center;}
    #pageloading{position:absolute; left:0px; top:0px; background:white url('../images/loading.gif') no-repeat center; width:100%; height:100%;z-index:99999;}
    .l-link{ display:block; line-height:22px; height:22px; padding-left:16px;border:1px solid white; margin:4px;}
    .l-link-over{ background:#FFEEAC; border:1px solid #DB9F00;}
    .l-winbar{ background:#2B5A76; height:30px; position:absolute; left:0px; bottom:0px; width:100%; z-index:99999;}
    .space{ color:#E7E7E7;}
    /* 顶部 */
    .l-topmenu{ margin:0; padding:0; height:31px; line-height:31px; background:url('../images/top.jpg') repeat-x bottom;  position:relative; border-top:1px solid #1D438B;  }
    .l-topmenu-logo{ color:#E7E7E7; padding-left:35px; line-height:26px;background:url('../images/topicon.gif') no-repeat 10px 5px;}
    .l-topmenu-welcome{  position:absolute; height:24px; line-height:24px;  right:30px; top:2px;color:#070A0C;}
    .l-topmenu-welcome a{ color:#E7E7E7; text-decoration:underline}
    .body-gray2014 #framecenter{
        margin-top:3px;
    }
    .viewsourcelink {
        background:#B3D9F7;  display:block; position:absolute; right:10px; top:3px; padding:6px 4px; color:#333; text-decoration:underline;
    }
    .viewsourcelink-over {
        background:#81C0F2;
    }
    .l-topmenu-welcome label {color:white;
    }
    #skinSelect {
        margin-right: 6px;
    }
    .l-table-edit {align:center;width: 100%;}
    .l-table-edit-td{ padding:4px;}
    .l-button-submit,.l-button-reset{width:80px; float:left; margin-left:10px; padding-bottom:2px;}
    .l-verify-tip{ left:230px; top:120px;}
    .desc {
        background: #fafafa; color:ActiveCaption;
        border-bottom:1px solid #d3d3d3; margin-top:3px; margin-bottom:3px;
    }
    .l-over .desc,.l-selected .desc {
        background: none;
    }
    .plus{
        color:darkred;
    }
    .minus{
        color:darkgreen;
    }
    /*]]>*/
</style>
<body style="padding:0px;background:#EAEEF5;">
<div id="pageloading"></div>
<div id="topmenu" class="l-topmenu">
    <div class="l-topmenu-logo">我的股票</div>
</div>
<div id="layout1" style="width:99.2%; margin:0 auto; margin-top:4px; ">
    <div position="left"  title="主要菜单" id="accordion1">
        <!--
        <div title="我的股票" class="l-scroll">
            <ul id="tree1" style="margin-top:3px;"></ul>
        </div>
        <div title="其他">
            <div style=" height:7px;"></div>
        </div>
        -->
    </div>
    <div position="center" id="framecenter">
        <div tabid="home" title="短线精灵" style="height:300px" >
            <!--
            <iframe frameborder="0" name="home" id="home" src=""></iframe>
            -->
        </div>
    </div>
</div>
</body>
</html>